package com.xnyzc.lhy.mis.controller.cmsapi.auditentry;

import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.mis.entity.cms.auditentry.OaSysAuditEntry;
import com.xnyzc.lhy.mis.service.cms.auditentry.H5AuditEntryService;
import com.xnyzc.lhy.order.entity.sms.OaSmsCodeRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zhaolijie
 * @date
 */
@RestController
@RequestMapping(value = "/h5")
public class H5AuditEntryController {


    @Autowired
    private H5AuditEntryService h5AuditEntryService;


    /**
     * 获取验证码
     *
     * @param oaSmsCodeRecord
     */
    @PostMapping(value = "/getH5SmsCode")
    public Rv getH5SmsCode(@RequestBody OaSmsCodeRecord oaSmsCodeRecord) {
        return h5AuditEntryService.getH5SmsCode(oaSmsCodeRecord);
    }

    /**
     * 效验验证码
     *
     * @param oaSmsCodeRecord
     */
    @PostMapping(value = "/validationH5SmsCode")
    public Rv validationH5SmsCode(@RequestBody OaSmsCodeRecord oaSmsCodeRecord) {
        return h5AuditEntryService.validationH5SmsCode(oaSmsCodeRecord);
    }

    /**
     * 获取字典车辆信息
     *
     * @param level：级别
     * @param parentId：父ID
     * @return
     */
    @GetMapping(value = "/getVehicleInfo")
    public Rv getVehicleInfo(String level, String parentId, String name) {
        return h5AuditEntryService.getVehicleInfo(level, parentId, name);
    }

    /**
     * 获取系统字典信息
     *
     * @return
     */
    @GetMapping(value = "/getSysDict")
    public Rv getSysDict() {
        return h5AuditEntryService.getSysDict();
    }

    /**
     * 获取城市信息
     *
     * @return
     */
    @GetMapping(value = "/getCityInfo")
    public Rv getCityInfo(String name) {
        return h5AuditEntryService.getCityInfo(name);
    }

    /**
     * 司机app注册
     *
     * @return
     */
    @PostMapping(value = "/insertAuditEntryInfo")
    public Rv insertAuditEntryInfo(@RequestBody OaSysAuditEntry oaSysAuditEntry) {
        return h5AuditEntryService.insertAuditEntryInfo(oaSysAuditEntry);
    }

    /**
     * 获取城市下所有的供应商
     *
     * @return
     */
    @GetMapping(value = "/getDriverManagersByCity")
    public Rv getDriverManagersByCity(String cityId) {
        return h5AuditEntryService.getDriverManagersByCity(cityId);
    }
}
